package com.codebuffer.nowcoder;

public class Multiply {
    public static int[] multiply(int[] A) {
        int[] B  = new int[A.length];

        for (int i = 0; i < A.length; i++) {
            B[i] = 1;
            if(i>0){
                B[i] = B[i-1]*A[i-1];
            }
        }
        int t = 1;
        for (int i = A.length - 2; i >= 0; i--) {
            t *= A[i+1];
            B[i] *= t;
        }

        return B;
    }

    public static void main(String[] args) {


    }
}
